<template>
    <div class="resource-manage">
        <div class="card-box">
            <div class="card-title">移交情况</div>
            <el-form ref="transferForm" :model="transferForm" class="form-wrap" size="small" :rules="transferForm_rules">
                <el-form-item label="移交方式" prop="transferType">
                    <el-select v-model="transferForm.transferType" placeholder="请选择移交方式">
                        <el-option
                            v-for="item in transferTypes"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="移交单位" prop="transferUnit">
                    <el-input v-model="transferForm.transferUnit" maxlength="50" placeholder="请输入移交单位"></el-input>
                </el-form-item>
                <el-form-item label="移交时间" prop="receiveTime">
                    <el-date-picker
                        v-model="transferForm.receiveTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        format="yyyy-MM-dd"
                        placeholder="选择日期"></el-date-picker>
                </el-form-item>
                <el-form-item label="备注" prop="transferDesc" class="full">
                    <el-input v-model="transferForm.transferDesc" maxlength="100"  placeholder="请输入备注"></el-input>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>

<script>
    import { getDict } from '~/utils'
    export default {
        name: "transfer-info",
        data() {
            return {
                transferTypes: [],
                transferForm: {
                    transferType: '',
                    transferUnit: '',
                    receiveTime: '',
                    transferDesc: ''
                },
                transferForm_rules: {
                    transferUnit: [ { required: false, message: "请输入0-50个字符串", max: "50",  trigger: "blur"  }],
                    transferDesc: [ { required: false, message: "请输入0-100个字符串", max: "100",  trigger: "blur"  }],
                }

            }
        },
        mounted() {
            this.transferTypes = getDict('transfer_types')
        },
        methods: {
            initTransfer(data){
                let t_data = {
                    transferType: data.transferType,
                    transferUnit: data.transferUnit,
                    receiveTime: data.receiveTime,
                    transferDesc: data.transferDesc
                }
               this.transferForm = t_data
            },
        }
    }
</script>

<style scoped lang='scss'>
    

    @include formWrap(2);

</style>
